<?php
/**

 */
class App_Form extends Zend_Form
{
	protected $options;
	
	public function __construct($options = null)
    {
        parent::__construct($options);
        
        $this->options = $options;
    }
    
    public function textElement($id, $label)
    {
    	$id = new App_Form_Element_Text($id);
    	
        $id->setLabel($label)
            ->setAttrib('size', '32')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty');
            
        return $id;
    }
    
    public function password($id,$label)
    {
    	$password = new App_Form_Element_Password($id);
        $password->setLabel($label)
            ->setAttrib('size', '32')
            ->addFilter('StripTags')
            ->addFilter('StringTrim');
        
        return $password;
    }
    
    public function checkBoxElement($id,$label)
    {
    	 $check_box = new App_Form_Element_Checkbox($id);
    	 $check_box->setLabel($label);
    	 
    	 return $check_box;
    }
    
    public function selectElement($id,$label,$arrValue)
    {
    	 $select = new Zend_Form_Element_Select($id);
    	 $select->setLabel($label)
    	 		 ->setMultiOptions($arrValue)
		         ->setRequired(true)
		         ->addValidator('NotEmpty', true);

    	 return $select;
    }
    
    public function hiddenElement($id)
    {
    	$id = new Zend_Form_Element_Hidden($id);
        $id->getDecorator('HtmlTag')->setOption('class', 'hidden');
        $id->removeDecorator('Label');
        
        return $id;
    }
    
    public function submit($id, $label)
    {
    	$submit = new Zend_Form_Element_Submit($id);
        $submit->setAttrib('id', $id)
            ->setLabel($label);
        
        return $submit;
    }
}
